(include "././obj/class.inc")
(include "././error/class.inc")
(include "././list/class.inc")

(def-class lisp obj
	(dec-method :vtable class/lisp/vtable)
	(dec-method :deinit class/lisp/deinit :final)
	(dec-method :create class/lisp/create :static (:r0 :r1 :r2 :r3) (:r0))
	(dec-method :init class/lisp/init :static (:r0 :r1 :r2 :r3 :r4 :r5))
	(dec-method :env_push class/lisp/env_push :static (:r0) (:r0 :r1))
	(dec-method :env_pop class/lisp/env_pop :static (:r0) (:r0 :r1))
	(dec-method :env_bind class/lisp/env_bind :static (:r0 :r1 :r2) (:r0 :r1))
	(dec-method :env_args_set class/lisp/env_args_set :static (:r0 :r3 :r5))
	(dec-method :env_args_sig class/lisp/env_args_sig :static (:r1 :r3 :r4 :r5) (:r2))
	(dec-method :env_args_type class/lisp/env_args_type :static (:r1 :r3 :r4) (:r2))
	(dec-method :env_args_match class/lisp/env_args_match :static (:r1 :r3 :r4) (:r2))
	(dec-method :read class/lisp/read :static (:r0 :r1 :r2) (:r0 :r1 :r2))
	(dec-method :read_char class/lisp/read_char :static (:r0 :r1 :r2) (:r0 :r1))
	(dec-method :read_quasi class/lisp/read_quasi :static (:r0 :r1 :r2 :r3) (:r0 :r1 :r2))
	(dec-method :read_sym class/lisp/read_sym :static (:r0 :r1 :r2) (:r0 :r1 :r2))
	(dec-method :read_str class/lisp/read_str :static (:r0 :r1 :r2) (:r0 :r1 :r2))
	(dec-method :read_num class/lisp/read_num :static (:r0 :r1 :r2) (:r0 :r1 :r2))
	(dec-method :repl_eval class/lisp/repl_eval :static (:r0 :r1) (:r0 :r1))
	(dec-method :repl_eval_list class/lisp/repl_eval_list :static (:r0 :r1) (:r0 :r1))
	(dec-method :repl_apply class/lisp/repl_apply :static (:r0 :r1 :r2) (:r0 :r1))
	(dec-method :repl_print class/lisp/repl_print :static (:r0 :r1 :r2 :r3) (:r0))
	(dec-method :repl_expand class/lisp/repl_expand :static (:r0 :r1) (:r0))
	(dec-method :repl_error class/lisp/repl_error :static (:r0 :r1 :r2 :r3) (:r0 :r1))
	(dec-method :repl_bind class/lisp/repl_bind :static (:r0 :r1) (:r0))
	(dec-method :repl_progn class/lisp/repl_progn :static (:r0 :r1 :r2 :r3) (:r0 :r1))
	(dec-method :lisp_ffi class/lisp/lisp_ffi :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_prebind class/lisp/lisp_prebind :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_macroexpand class/lisp/lisp_macroexpand :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_lambda class/lisp/lisp_lambda :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_macro class/lisp/lisp_macro :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_quote class/lisp/lisp_quote :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_qquote class/lisp/lisp_qquote :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_if class/lisp/lisp_if :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_ifn class/lisp/lisp_ifn :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_cond class/lisp/lisp_cond :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_condn class/lisp/lisp_condn :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_progn class/lisp/lisp_progn :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_while class/lisp/lisp_while :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_until class/lisp/lisp_until :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_print class/lisp/lisp_print :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_prin class/lisp/lisp_prin :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_copy class/lisp/lisp_copy :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_apply class/lisp/lisp_apply :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_repl class/lisp/lisp_repl :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_eval class/lisp/lisp_eval :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_eval_list class/lisp/lisp_eval_list :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_throw class/lisp/lisp_throw :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_catch class/lisp/lisp_catch :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_bind class/lisp/lisp_bind :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_read class/lisp/lisp_read :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_mcall class/lisp/lisp_mcall :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_env_push class/lisp/lisp_env_push :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_env_pop class/lisp/lisp_env_pop :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_identity class/lisp/lisp_identity :static (:r0 :r1) (:r0 :r1))
	(dec-method :lisp_repl_info class/lisp/lisp_repl_info :static (:r0 :r1) (:r0 :r1))
	(dec-method :run class/lisp/run))

(def-struct lisp obj_size
	;this first block of ptrs gets derefed on deinit
	(ptr stdin stdout stderr environment sym_underscore sym_optional
		sym_rest sym_ignore sym_most sym_nil sym_t sym_lambda sym_macro
		sym_quote sym_qquote sym_unquote sym_trunc sym_splicing
		sym_ffi sym_stack_frame func_ffi func_lambda func_macro func_quote
		func_qquote stream_name)
	(ptr stack error)
	(uint seq_idx stream_line nextsym))
